package main
import "fmt"
func main(){
	a := [5] int { 1, 3, 5, 2, 4}
	fmt.Printf("a type is : %T\n", a)
	
	b := a[1:3:5]
	fmt.Printf("b type is :%T\n", b)
	
	/*len = 3 - 1，第二数字减去第一数字， cap = 5 - 1，第三数字减去第一数字*/
	fmt.Printf("len(b) = %d\tcap(b) = %d\n", len(b), cap(b))
	
	/*数组，[]是常量值*/
	/*切片，[]是空值*/
	var c [5]int	//这是数组
	var d []int	//这是切片
	fmt.Printf("c type is : %T\n", c)
	fmt.Printf("d type is : %T\n", d)
	
	/*切片的好处在于，大小不固定*/
	d = append(d,11)
	fmt.Println("d = ", d)
	d = append(d,22)
	fmt.Println("d = ", d)
	d = append(d,33)
	fmt.Println("d = ", d)
}